﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.Regions;
using ShellInfrastructure;
using Microsoft.Practices.Unity;
using ModuleExternalProducersAdd.Views;
using ModuleExternalProducersAdd.ViewModels;

namespace ModuleExternalProducersAdd
{
    public class ExternalProducersAddModule : ModulesInfrastructure.SharedModule
    {
        protected override void RegisterViewsInRegions()
        {
            RegionManager.RegisterViewWithRegion(RegionNames.LeftRegionName, () => UnityContainer.Resolve<IProducerAddView>());
            RegionManager.RegisterViewWithRegion(RegionNames.RightRegionName, () => UnityContainer.Resolve<IProducerAddNewView>());
        }

        protected override void RegisterTypesDependencies()
        {
            UnityContainer.RegisterType<IProducerAddView, ProducerAddView>(new ContainerControlledLifetimeManager());
            UnityContainer.RegisterType<IProducerAddNewView, ProducerAddNewView>(new ContainerControlledLifetimeManager());

            UnityContainer.RegisterType<IProducerAddViewModel, ProducerAddViewModel>(new ContainerControlledLifetimeManager());                      
        }
    }
}

